# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=detect-sniffer
pkgver=159.a359262
pkgrel=3
groups=('blackarch' 'blackarch-defensive' 'blackarch-networking')
pkgdesc='Tool that detects sniffers in the network.'
arch=('any')
url='https://github.com/galkan/tools/tree/master/detect_sniffer'
license=('custom:unknown')
depends=('python2' 'python2-ldap' 'python2-scapy')
makedepends=('git')
source=('git+https://github.com/galkan/tools')
sha512sums=('SKIP')

pkgver() {
  cd tools

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd tools/detect_sniffer

  sed -i 's|python$|python2|g' detect_sniffer.py
}

package() {
  cd tools/detect_sniffer

  install -Dm 755 detect_sniffer.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

